<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>javascrip脚本语言案例dom树</title>
	</head>
	<body>
		<h1>javascript  脚本语言  之 dom树</h1>
		
		<a href="http://www.taobao.com" target="_blank" name="taobao">淘宝</a>
		<a href="http://www.jd.com" target="_blank" class="jingdong">京东</a>
		<a href="http://www.pinduoduo.com" target="_blank" id="pd">拼多多</a>
		
		<button onclick="alert(document.getElementsByTagName('a').length);">A标签数量</button>
		<button onclick="alert(document.getElementsByName('taobao')[0]);">淘宝链接</button>
		<button onclick="alert(document.getElementsByName('taobao')[0].innerText);">淘宝内容</button>
	</body>
	<script>
		alert(document.title);
		var h1 = document.getElementsByName(h1);
		alert(h1[0].innerText);
	</script>
</html>
